

#import <Foundation/Foundation.h>
#include <CommonCrypto/CommonCrypto.h>
#import <CommonCrypto/CommonCryptor.h>
@interface NSData (extension)
- (NSString *)md2String;
- (NSString *)md4String;
- (NSString *)md5String;

- (NSData *)md2Data;
- (NSData *)md4Data;
- (NSData *)md5Data;

- (NSString *)sha1String;
- (NSString *)sha224String;
- (NSString *)sha256String;
- (NSString *)sha384String;
- (NSString *)sha512String;

- (NSData *)sha1Data;
- (NSData *)sha224Data;
- (NSData *)sha256Data;
- (NSData *)sha384Data;
- (NSData *)sha512Data;

- (NSData *)hmacSha1DataWithKey:(NSString *)key;
- (NSData *)hmacMD5DataWithKey:(NSString *)key;
- (NSData *)hmacSha256DataWithKey:(NSString *)key;
- (NSData *)hmacSha384DataWithKey:(NSString *)key;
- (NSData *)hmacSha512DataWithKey:(NSString *)key;
- (NSData *)hmacSha224DataWithKey:(NSString *)key;

- (NSString *)encodeBase64;
+ (NSData *)decodeBase64WithString:(NSString *)strBase64;

+ (NSData*)doCipherUse3DesMethod:(NSData *)sTextIn
                             key:(NSData *)sKey
                         context:(CCOperation)encryptOrDecrypt;
+ (NSData *) doCipherUseCastMethod:(NSData *)sTextIn
                               key:(NSData *)sKey
                           context:(CCOperation)encryptOrDecrypt;
+ (NSData*)doCipherUseDesMethod:(NSData *)sTextIn
                            key:(NSData *)sKey
                        context:(CCOperation)encryptOrDecrypt;
+ (NSData*)doCipherUseAes128Method:(NSData *)sTextIn
                               key:(NSData *)sKey
                           context:(CCOperation)encryptOrDecrypt;
+ (NSData*)doCipherUseAesMethod:(NSData *)sTextIn
                            key:(NSData *)sKey
                        context:(CCOperation)encryptOrDecrypt;
@end
